﻿
@{
    ViewBag.Title = "LinkList";
}
<!DOCTYPE html>
 
<head>
    
   
    <link type="text/css" href="../Layui/css/layui.css" rel="stylesheet" media="all">
    <script type="text/javascript" src="../Htc/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="../Layui/layui.js"></script>
   
</head>
<form class="layui-form" action="" lay-filter="component-form-group">
    <div class="layui-card-body">
        <table class="layui-table" lay-skin="line" lay-filter="Rytable" id="Rytable"></table>
    </div>
 </form>
<script>
    layui.config({
        base: '../Layui/'
    }).extend({
        index: 'lib/index'
        }).use('index');
    layui.use('table', function () {
        var table = layui.table;
        var djUrl = "../Contract/LinkList/Data";

        var column = [[{ field: 'id', title: 'ID' }, { field: 'KidsName', title: '宝宝姓名' }, { field: 'LinkTel', title: '联系电话' }, { field: 'LinkName', title: '姓名' }, { field: 'Sex', title: '性别' }]];
        
        table.render({
            elem: '#Rytable'
            , url: djUrl //数据接口
            , where: { keyCode: "@ViewBag.keyCode",  id: "@ViewBag.Cid" ,t: new Date().getTime() }
           
            , limit: 10
            , page: true //是否显示分页
            , cellMinWidth: 120 
            , cols: column

            , skin: 'line' //表格风格
            , even: true

        });
        table.on('row(Rytable)', function (obj) {
            index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            var data = obj.data;
            parent.layui.$("#_LinkCustId").val(data.id); 
            parent.layui.$("#dt").html("添加第二个合同关系人:"+data.LinkName+"小名："+data.KidsName); 
            parent.layer.close(index);
        });
    });
</script>